package com.restaurant.application.minifacade.data;

import com.google.common.collect.Lists;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import java.lang.String;
import java.util.List;

public class SearchGoodsBO implements PickableBean {
    
    public static final String FN_SHOPID = "shopId";
    public static final String FN_TYPEID = "typeId";
    public static final String FN_CONTENT = "content";
    
    public static final List<String> FIELD_NAMES = Lists.newArrayList(
             FN_SHOPID,
             FN_TYPEID,
             FN_CONTENT);
    
    private String shopId;
    private String typeId;
    private String content;
    
    public SearchGoodsBO(String shopId, String typeId, String content) {
        setShopId(shopId);
        setTypeId(typeId);
        setContent(content);
    }
    
    public SearchGoodsBO() {
    }
    
    public SearchGoodsBO duplicate() {
        SearchGoodsBO result = new SearchGoodsBO();
        result.shopId = this.shopId;
        result.typeId = this.typeId;
        result.content = this.content;
        return result;
    }
    
    @Override
    public String toString() {
        return Convert.toJson(this);
    }
    
    public String getShopId() {
        return shopId;
    }
    
    public void  setShopId(String value) {
        this.shopId = value;
    }
    
    public SearchGoodsBO withShopId(String value) {
        setShopId(value);
        return this;
    }
    
    public SearchGoodsBO withShopId(String value, String defaultValue) {
        setShopId(value == null ? defaultValue : value);
        return this;
    }
    
    public String getTypeId() {
        return typeId;
    }
    
    public void  setTypeId(String value) {
        this.typeId = value;
    }
    
    public SearchGoodsBO withTypeId(String value) {
        setTypeId(value);
        return this;
    }
    
    public SearchGoodsBO withTypeId(String value, String defaultValue) {
        setTypeId(value == null ? defaultValue : value);
        return this;
    }
    
    public String getContent() {
        return content;
    }
    
    public void  setContent(String value) {
        this.content = value;
    }
    
    public SearchGoodsBO withContent(String value) {
        setContent(value);
        return this;
    }
    
    public SearchGoodsBO withContent(String value, String defaultValue) {
        setContent(value == null ? defaultValue : value);
        return this;
    }
    
    public Object getValueOf(String name) {
        switch(name) {
        case "shopId": return getShopId();
        case "typeId": return getTypeId();
        case "content": return getContent();
        }
        return null;
    }
    
    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }
    
    @Override
    public int hashCode() {
        return signature().hashCode();
    }
    
    @Override
    public boolean equals(Object o) {
        if(!(o instanceof SearchGoodsBO)) return false;
        return signature().equals(((SearchGoodsBO)o).signature());
    }
    
    public String signature() {
        throw new RuntimeException("Bean SearchGoodsBO has no signature defined, no hash code or equals possible.");
    }
}
